package com.shangxia.dog.vo;

import com.shangxia.dog.base.entity.Admin;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;
import java.util.Date;

/**
 * @author zhouya24
 * @date 2021/11/18 15:26
 * @apiNote
 * @see Admin
 */

@Slf4j
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
    private Long id;

    @ApiModelProperty(value = "姓名", required = true)
    private String name;

    @ApiModelProperty("电话")
    private String phone;

    @ApiModelProperty("固定电话")
    private String telephone;

    @ApiModelProperty("住址")
    private String address;

    @ApiModelProperty("是否启用")
    private Boolean enabled;

    @ApiModelProperty(value = "登录名", required = true)
    private String username;

    @ApiModelProperty(value = "登录密码", required = true)
    private String password;

    @ApiModelProperty("头像")
    private String userFace;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("创建时间")
    private String createTimeStr;

    public String getCreateTimeStr() {
        if (null != createTimeStr) {
            return createTimeStr;
        } else if (null != createTime) {
            return createTime.getTime() + "";
        }
        return createTimeStr;
    }

    public void setCreateTimeStr() {
        if (null != createTime) {
            createTimeStr = createTime.getTime() + "";
        }
    }
}
